﻿namespace SampleApplication.Library
{
    using System.Collections.Generic;
    using Codeplex.Unity.AutoRegister;
    using Microsoft.Practices.Unity;

    /// <summary>
    /// Custom InjectionMemberProvider.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    class InjectionDataContextProvider<T> : InjectionMemberProvider
    {
        public override IEnumerable<InjectionMember> GetInjectionMembers()
        {
            return new[]
            {
                // injection datacontext property.
                new InjectionProperty("DataContext", new ResolvedParameter<T>())
            };
        }
    }


}
